<!-- 权限编辑 -->
<div class="modal-header">
    <button type="button" class="close" data-dismiss="modal">
        <span aria-hidden="true">&times;</span><span class="sr-only">Close</span>
    </button>
    <h4 class="modal-title" id="mod-title">{$meta_title}</h4>
</div>
<div class="modal-body" id="content">
    <form class="form-horizontal m-t" id="signupForm">
        <input type="hidden" name="id" value="{$ruleItem.id}">
        <div class="form-group">
            <label class="col-sm-3 control-label">上级:</label>
            <div class="col-sm-7">
                <select name="pid" data-placeholder="选择菜单..." class="form-control" tabindex="2">
                    {foreach($rule_tree as $key => $tree_info)}
                    <option data-key="{$key}" {if($key== $ruleItem.pid)}selected{/if} value="{$key}" >{$tree_info}</option>
                    {/foreach}
                </select>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">类型:</label>
            <div class="col-sm-7">
                <select name="type" data-placeholder="选择类型..." class="form-control">
                    <option data-key="1" value="1" >菜单</option>
                    <option data-key="2" value="2" >权限</option>
                </select>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">标识:</label>
            <div class="col-sm-7">
                <label><input type="text" class="form-control" name="name" value="{$ruleItem.name}"></label>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">标题:</label>
            <div class="col-sm-7">
                <label><input type="text" class="form-control" name="title" value="{$ruleItem.title}" ></label>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">访问URL:</label>
            <div class="col-sm-7">
                <label><input type="text" class="form-control" name="url" value="{$ruleItem.url}" ></label>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">图标:</label>
            <div class="col-sm-7">
                <label><input type="text" class="form-control" name="icon" value="{$ruleItem.icon}" ></label>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">排序:</label>
            <div class="col-sm-7">
                <label><input type="text" class="form-control" name="sort" value="{$ruleItem.sort}" ></label>
            </div>
        </div>
    </form>
</div>
<div class="modal-footer">
    <button type="button" class="btn btn-white" data-dismiss="modal">取消</button>
    <button type="button" class="btn btn-primary btn_save" data-dismiss="modal">快捷保存</button>
</div>

<script type="text/javascript">
    $(document).ready(function(){
        $(".btn_save").bind("click",function(){
            //  save
            $.ajax({
                url     :   "{:url('AdminAuth/editAuth')}",
                dataType:   "json",
                type    :   "post",
                data    :   $("#signupForm").serialize(),
                success :   function( obj ){
                    layer.msg(obj.msg,{
                        shift   :   3
                    },function(){
                        if( obj.code === 1){
                            $('#rule_list').bootstrapTable('refresh', null);
                        }
                    });
                }
            });
        });

    });
</script>